import React, { PureComponent } from 'react';
import style from "styled-components";

const store = require("store");

export default class CoursewareLibraryManagement extends PureComponent {
  constructor(props, context) {
    super(props, context);
    this.state = {
      // currentURL: "http://localhost:3000/#/course/manage",
    };
  }

  componentDidMount = () => {
    //sessionId
    console.log('百课堂＝＝store.get("saas")["sessionId"]', store.get("saas")["sessionId"]);
    // console.log('innerHTML', document.getElementById("CoursewareLibraryManagement").innerHTML);
    // document.getElementById("CoursewareLibraryManagement").innerHTML = '<object type="text/html" data="http://www.alloyteam.com/nav/" width="100%" height="100%"></object>';
  }
  render() {
    // const { currentURL } = this.state;
    return (
      <Container>
        {store.get("coursewareLibraryManagementURL") !== undefined ? (
          <iframe title="订单管理" src={store.get("coursewareLibraryManagementURL")["coursewareLibraryManagementURL"] + '?sessionId=' + store.get("saas")["sessionId"]} width="100%" height="100%" frameBorder="0">
            您的浏览器不支持iframe，请升级
        </iframe>
        ) : ''
        }

        {/*
        {store.get("coursewareLibraryManagementURL") !== undefined ? (
          <iframe title="订单管理" src={currentURL + '?sessionId=' + store.get("saas")["sessionId"]} width="100%" height="100%" frameBorder="0">
            您的浏览器不支持iframe，请升级
          </iframe>
        ) : ''
        }
         */}
        {/*
        课件库管理
        <div id="CoursewareLibraryManagement" />
        <iframe title="ds" src="http://www.alloyteam.com/nav/" width="100%" height="100%" frameBorder="0">
          您的浏览器不支持iframe，请升级
        </iframe>
        <div style={{ width: '100%', height: '800px' }}>
          <iframe title="ds" src="http://120.76.218.179:9149/pxxtfront/train-office/#/product" width="100%" height="100%" frameBorder="0">
            您的浏览器不支持iframe，请升级
          </iframe>
      </div>
      */}
      </Container>
    );
  }
}

const Container = style.div`
  padding:24px;
  width:100%;
  height:100%;
`;
